//
//  UIImage+Scale.m
//  ONEChat
//
//  Created by 楼楚 on 16/1/6.
//  Copyright © 2016年 Chu Lou. All rights reserved.
//

#import "UIImage+Scale.h"

@implementation UIImage (Scale)
-(UIImage*)scaleToSize:(CGSize)size
{
    
    UIGraphicsBeginImageContext(size);
    
    [self drawInRect:CGRectMake(0, 0, size.width, size.height)];
   
    UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
   
    return scaledImage;
}
@end
